package ttc.mbackup.newsmsbackup;


import android.app.ListActivity;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.widget.SimpleCursorAdapter;

public class NewSMSBackupList extends ListActivity {
	private SMSQuery smsQuery;
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		smsQuery= new SMSQuery();
		setContentView(R.layout.list_sms);
		Uri uriSMS=Uri.parse("content://sms");
		//Cursor cursorSMS= smsQuery.getAllSMS();
		Cursor cursorSMS=getContentResolver().query(uriSMS, null, null, null, null);
		SimpleCursorAdapter simpleCursorAdapter= new SimpleCursorAdapter(getApplicationContext(), R.layout.row_sms, cursorSMS, new String[]{"address","body"},new int[]{R.id.txtContactPhone,R.id.txtSMSBody});
		int i = cursorSMS.getCount();
		Log.i("tag",Integer.toString(i));
		setListAdapter(simpleCursorAdapter);
	}
}
